placesview: fix testsuite
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 11 Apr 2017 19:46:14 +0000 (16:46 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 11 Apr 2017 19:50:33 +0000 (16:50 -0300)
Because the network monitor can perfectly be NULL,
the tests were failing on that for GtkPlacesView
always tries to disconnect this handler.

Fix that by only disconnecting the handler when
the network monitor exists.

https://bugzilla.gnome.org/show_bug.cgi?id=781195

gtk/gtkplacesview.c

index 12b556873c1ba3874c787d48cb271525b1e7eafe..12c81b03eb7b86b7c72081d2177286ce0a5200cb 100644 (file)
@@ -398,7 +398,9 @@ gtk_places_view_destroy (GtkWidget *widget)
   priv->destroyed = 1;
 
   g_signal_handlers_disconnect_by_func (priv->volume_monitor, update_places, widget);
-  g_signal_handlers_disconnect_by_func (priv->network_monitor, update_places, widget);
+
+  if (priv->network_monitor)
+    g_signal_handlers_disconnect_by_func (priv->network_monitor, update_places, widget);
 
   g_cancellable_cancel (priv->cancellable);
   g_cancellable_cancel (priv->networks_fetching_cancellable);